<?php

/**
 * Post form base class.
 *
 * @package    blogallery
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BasePostForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'user_id'       => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'handle'        => new sfWidgetFormInput(),
      'file'          => new sfWidgetFormInput(),
      'datetime'      => new sfWidgetFormDateTime(),
      'published'     => new sfWidgetFormInput(),
      'comment_allow' => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorPropelChoice(array('model' => 'Post', 'column' => 'id', 'required' => false)),
      'user_id'       => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id')),
      'handle'        => new sfValidatorString(array('max_length' => 100)),
      'file'          => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'datetime'      => new sfValidatorDateTime(array('required' => false)),
      'published'     => new sfValidatorInteger(),
      'comment_allow' => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('post[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Post';
  }

  public function getI18nModelName()
  {
    return 'PostI18n';
  }

  public function getI18nFormClass()
  {
    return 'PostI18nForm';
  }

}
